LOGIN=function(){}
LOGIN.prototype.get=function(username, password){
	var fncSuc = XHR.Delegate(this,this.onGet);
	var param = {act:"login",username:username,password:password};
	new XHR("post",fncSuc).send($PN+"/DoLogin",param);
}
LOGIN.prototype.onGet=function(r){
	var xml = r.xml;
	var value = xml.getElementsByTagName("root")[0].getAttribute("value");
	if(value=="true"){
		window.location = $PN + "/admin.html";
		return;
	}
	else{
		alert("Your username or password is incorrect");
		return;
	}
}
function login(){
	var username = $N("username")[0].value;
	var password = $N("password")[0].value;
	new LOGIN().get(username,password);
}